<?php
include_once 'lib/DataProvider.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/quocha/lib/Sanpham.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/quocha/lib/DanhMuc.php';
$sanphamOb = new Sanpham();
$danhmucOb = new DanhMuc();
$danhmucList = $danhmucOb->layDSDanhMuc();
?>

<?php include('layout/header.php') ?>
<div id="content_top"></div>
<?php foreach ($danhmucList as $item): ?>
    <div id="content_middle">
        <h3><a href="sanphamtheodanhmuc.php?id="><?php echo $item['tieude'] ?></h3>
        <?php $sanphamlist = $sanphamOb->layDSSanPham($item['id']); ?>
        <?php $t = 1; ?>
        <?php foreach ($sanphamlist as $item1): ?>
            <div class="<?php
        if ($t == 1) {
            echo "product_box margin_r20";
            $t = $t + 1;
        } else if ($t == 2) {
            echo "product_box";
            $t == 1;
        }
            ?>">
                <a href="#"><img src="<?php echo $item1['hinhanh'] ?>" alt="Golden Bell" width="200" height="250" /></a>
                <h3><?php echo $item1['ten'] ?></h3>
                <p class="price">Giá: <span><?php echo $item1['gia'] ?> VNĐ</span></p>
                <a href="#">Chi tiết</a>
                <div class="cleaner"></div>
            </div>
        <?php endforeach; ?>
        <div class="cleaner"></div>   
    </div>
<?php endforeach; ?>
<!-- ket thuc ngay day -->
<div id="content_bottom"></div>
</div>
<?php include('layout/footer.php') ?>

